home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / misc / shokdial / animation / intro2.c < prev   
Encoding:
C/C++ Source or Header  |  1998-08-13  |  1.1 KB  |  67 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <signal.h>
  4. #include "colors.h"
  5.  
  6. #define TIME 2000
  7.  
  8. void sighandler(int signum);
  9.  
  10. void main()
  11. {
  12.   register int i, j;
  13.   register int rand;
  14.  
  15.   char buf[5][10];
  16.  
  17.  
  18.   signal(SIGINT,  sighandler);
  19.   signal(SIGTERM, sighandler);
  20.   signal(SIGTSTP, sighandler);
  21.   signal(SIGQUIT, sighandler);
  22.   
  23.   for (j = 0; j < 15; j++) {
  24.      for(i = 0; i < 5; i++ )  { 
  25.        repeat:
  26.       rand = random() % 37;
  27.  
  28.      if ((rand >= 31) && (rand <= 37)) 
  29.             sprintf(buf[i], "\033[%dm\033[1m", rand); 
  30.      else goto repeat;
  31.      }
  32.  
  33.      printf("\t\t\t  %sJ ", buf[0]);
  34.      usleep(TIME);
  35.      fflush(stdout);
  36.  
  37.      printf("%sA ", buf[1]);
  38.      usleep(TIME);
  39.      fflush(stdout);
  40.  
  41.      printf("%sN ", buf[2]);
  42.      usleep(TIME);
  43.      fflush(stdout);
  44.  
  45.      printf("%sO ", buf[3]);
  46.      usleep(TIME);
  47.      fflush(stdout);
  48.  
  49.      printf("%sV ", buf[4]);
  50.      usleep(TIME);
  51.      fflush(stdout);
  52.  
  53.      printf("%sA\r", buf[5]);
  54.      usleep(TIME);
  55.      fflush(stdout);
  56.  
  57.      printf("%s", NORMAL);
  58.   }
  59. }
  60.  
  61. void sighandler(int signum)
  62. {
  63.   printf("%s", NORMAL);
  64.   printf("\nw00w00!\n");
  65.   exit(0);
  66. }
  67.